// role表相关sql语句
const ROLE_QUERY_SQL =
  "select * from role where userName=? and userPhone=? and userPwd=?";
const ROLE_QUERY_NAME_SQL = "select * from role where userName=?";
const ROLE_QUERY_PHONE_SQL = "select * from role where userPhone=?";
const ROLE_QUERY_AVATARPATH_SQL =
  "select avatarPath from role where userName=? and userPhone=?";
const ROLE_INSERT_SQL = `insert INTO role (userName,userPhone,userPwd,isAdministrator) values (?,?,?,1)`;
const ROLE_UPDATE_PHONE_SQL = `update role set userPhone=? where userName=?`;
const ROLE_UPDATE_USER_INfO_SQL = `update role set userName=?,userPhone=?,userPwd=? where userName=? and userPhone=? and userPwd=?`;
const ROLE_UPDATE_USER_AVATAR_SQL = `update role set avatarPath = ? where userName = ? and userPhone =?`;
const ROLE_DELETE_SQL = `delete FROM role WHERE id=?`;
// address表相关sql语句
const ADDRESS_QUERY_USER_INFO_SQL =
  "select subUserName,subUserPhone,subUserAddress,mode from address where userName=?";
const ADDRESS_UPDATE_ADDRESS_SQL =
  "update address set subUserName=?,subUserPhone=?,subUserAddress=?,mode=? where subUserName=? and subUserPhone=? and userName=?";
const ADDRESS_INSERT_SQL =
  "insert into address (userName,subUserName,subUserPhone,subUserAddress,mode) values (?,?,?,?,?)";
const ADDRESS_DELETE_SQL =
  "delete from address where userName=? and subUserName=? and subUserPhone=? and subUserAddress=?";
//agreement表相关sql语句
const AGREEMENT_QUERY_AGREEMENT_SQL =
  "select content from agreement where agreementName=?";
// stage表相关sql语句
const STAGE_QUERY_STAGE_SQL = "select * from stage where userName=?";
const STAGE_UPDATE_STAGE_SQL =
  "update stage set isTakeFromOneself=?,timeChoose=? where userName=? and address=?";
const STAGE_INSERT_SQL =
  "insert into `stage` (`userName`,`stageName`,`address`) values (?,?,?)";
const STAGE_DELETE_SQL =
  "delete from stage where userName=? and stageName=? and address=?";
//crashfeedback表相关sql语句
const CRASHFEEDBACK_INSERT_NOT_WITH_IMGURLS_SQL =
  "insert into `crashfeedback` (`userPhone`,`crashType`,`desc`,`crashTime`) values (?,?,?,?)";
const CRASHFEEDBACK_UPDATE_IMGURLS_SQL =
  "update crashfeedback set imageUrls =? where userPhone =? and crashType=? and crashTime=?";
//complaintfeedback表相关sql语句
const COMPLAINTFEEDBACK_INSERT_NOT_WITH_IMGURLS_SQL =
  "insert into `complaintfeedback` (`complaintType`, `desc`,`complaintTime`) values (?,?,?)";
const COMPLAINTFEEDBACK_UPDATE_IMGURLS_SQL =
  "update `complaintfeedback` set `imageUrls`=? where `complaintType`=? and `desc`=? and `complaintTime`=?";
//order表相关sql语句
const ORDER_QUERY_SQL =
  "select * from `order` where `userName`=? and `userPhone`=?";
const ORDER_QUERY_GOODSIMGURL_SQL =
  "select goodsImgURl from `order` where `userName`=? and `userPhone`=? and `goodsName`=?";
const ORDER_UPDATE_SIGNFORSTATUS_AND_SIGNFORTIME_SQL =
  "update `order` set `signForStatus`=?,`signForTime`=? where `userName`=? and `userPhone`=? and `goodsName`=?";
//campusscenery表相关sql
const CAMPUSSCENERY_QUERY_SQL = "select * from campusscenery";
// mail表相关sql
const MAIL_INSERT_REASON0_WITH_VISITTIME_SQL =
  "insert into `mail` (`reason`,`userName`,`placeOrderTime`,`mailUserName`,`mailUserPhone`,`mailAddress`,`pickUpUserName`,`pickUpUserPhone`,`pickUpAddress`,`mode`,`visitTime`,`goodsInformation`) values (?,?,?,?,?,?,?,?,?,?,?,?)";
const MAIL_INSERT_REASON0_WITH_STAGENAME_SQL =
  "insert into `mail` (`reason`,`userName`,`placeOrderTime`,`mailUserName`,`mailUserPhone`,`mailAddress`,`pickUpUserName`,`pickUpUserPhone`,`pickUpAddress`,`mode`,`stageName`,`goodsInformation`) values (?,?,?,?,?,?,?,?,?,?,?,?)";
const MAIL_INSERT_REASON1_WITH_VISITTIME_SQL =
  "insert into `mail` (`reason`,`userName`,`placeOrderTime`,`mailUserName`,`mailUserPhone`,`mailAddress`,`enterpriseName`,`enterprisePhone`,`enterpriseAddress`,`mode`,`visitTime`,`goodsInformation`) values (?,?,?,?,?,?,?,?,?,?,?,?)";
const MAIL_INSERT_REASON1_WITH_STAGENAME_SQL =
  "insert into `mail` (`reason`,`userName`,`placeOrderTime`,`mailUserName`,`mailUserPhone`,`mailAddress`,`enterpriseName`,`enterprisePhone`,`enterpriseAddress`,`mode`,`stageName`,`goodsInformation`) values (?,?,?,?,?,?,?,?,?,?,?,?)";
const MAIL_QUERY_SQL = "select * from mail where userName =?";
// price表相关sql语句
const PRICE_QUERY_SQL = "select * from price";

module.exports = {
  ROLE_QUERY_SQL,
  ROLE_QUERY_NAME_SQL,
  ROLE_QUERY_PHONE_SQL,
  ROLE_QUERY_AVATARPATH_SQL,
  ROLE_INSERT_SQL,
  ROLE_UPDATE_PHONE_SQL,
  ROLE_UPDATE_USER_INfO_SQL,
  ROLE_UPDATE_USER_AVATAR_SQL,
  ROLE_DELETE_SQL,
  ADDRESS_QUERY_USER_INFO_SQL,
  ADDRESS_UPDATE_ADDRESS_SQL,
  ADDRESS_INSERT_SQL,
  ADDRESS_DELETE_SQL,
  AGREEMENT_QUERY_AGREEMENT_SQL,
  STAGE_QUERY_STAGE_SQL,
  STAGE_UPDATE_STAGE_SQL,
  STAGE_INSERT_SQL,
  STAGE_DELETE_SQL,
  CRASHFEEDBACK_INSERT_NOT_WITH_IMGURLS_SQL,
  CRASHFEEDBACK_UPDATE_IMGURLS_SQL,
  COMPLAINTFEEDBACK_INSERT_NOT_WITH_IMGURLS_SQL,
  COMPLAINTFEEDBACK_UPDATE_IMGURLS_SQL,
  ORDER_QUERY_SQL,
  ORDER_QUERY_GOODSIMGURL_SQL,
  ORDER_UPDATE_SIGNFORSTATUS_AND_SIGNFORTIME_SQL,
  CAMPUSSCENERY_QUERY_SQL,
  MAIL_INSERT_REASON0_WITH_VISITTIME_SQL,
  MAIL_INSERT_REASON0_WITH_STAGENAME_SQL,
  MAIL_INSERT_REASON1_WITH_VISITTIME_SQL,
  MAIL_INSERT_REASON1_WITH_STAGENAME_SQL,
  MAIL_QUERY_SQL,
  PRICE_QUERY_SQL,
};
